package 牛客_面试必刷.Month07.day09;

public class 二维数组中的查找 {
    public boolean Find(int target, int [][] array) {
        int row = array.length;//行
        int col = 0;//列
        int i = 0,j = array[0].length - 1;
        while(i < row && j >= col){
            int num = array[i][j];
            if(num < target){
                i++;
            }else if(num > target){
                j--;
            }else{
                return true;
            }
        }
        return false;
    }
}
